Optimal. Leaf size=82 \[ -\frac {(b c-a d) (a d+3 b c) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}+\frac {x (b c-a d)^2}{2 c d^2 \left (c+d x^2\right )}+\frac {b^2 x}{d^2} \]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {390, 385, 205} \begin {gather*} -\frac {(b c-a d) (a d+3 b c) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}+\frac {x (b c-a d)^2}{2 c d^2 \left (c+d x^2\right )}+\frac {b^2 x}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 385
Rule 390
Rubi steps
\begin {align*} \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx &=\int \left (\frac {b^2}{d^2}-\frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{d^2 \left (c+d x^2\right )^2}\right ) \, dx\\ &=\frac {b^2 x}{d^2}-\frac {\int \frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{\left (c+d x^2\right )^2} \, dx}{d^2}\\ &=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {((b c-a d) (3 b c+a d)) \int \frac {1}{c+d x^2} \, dx}{2 c d^2}\\ &=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {(b c-a d) (3 b c+a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 89, normalized size = 1.09 \begin {gather*} -\frac {\left (-a^2 d^2-2 a b c d+3 b^2 c^2\right ) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}+\frac {x (b c-a d)^2}{2 c d^2 \left (c+d x^2\right )}+\frac {b^2 x}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.87, size = 302, normalized size = 3.68 \begin {gather*} \left [\frac {4 \, b^{2} c^{2} d^{2} x^{3} + {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {-c d} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right ) + 2 \, {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{4 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}, \frac {2 \, b^{2} c^{2} d^{2} x^{3} - {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right ) + {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{2 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.57, size = 95, normalized size = 1.16 \begin {gather*} \frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} + \frac {b^{2} c^{2} x - 2 \, a b c d x + a^{2} d^{2} x}{2 \, {\left (d x^{2} + c\right )} c d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 129, normalized size = 1.57 \begin {gather*} \frac {a^{2} x}{2 \left (d \,x^{2}+c \right ) c}+\frac {a^{2} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \sqrt {c d}\, c}-\frac {a b x}{\left (d \,x^{2}+c \right ) d}+\frac {a b \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d}\, d}+\frac {b^{2} c x}{2 \left (d \,x^{2}+c \right ) d^{2}}-\frac {3 b^{2} c \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \sqrt {c d}\, d^{2}}+\frac {b^{2} x}{d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.84, size = 96, normalized size = 1.17 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x}{2 \, {\left (c d^{3} x^{2} + c^{2} d^{2}\right )}} + \frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.02, size = 124, normalized size = 1.51 \begin {gather*} \frac {b^2\,x}{d^2}+\frac {x\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,c\,\left (d^3\,x^2+c\,d^2\right )}+\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{\sqrt {c}\,\left (a^2\,d^2+2\,a\,b\,c\,d-3\,b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{2\,c^{3/2}\,d^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.70, size = 236, normalized size = 2.88 \begin {gather*} \frac {b^{2} x}{d^{2}} + \frac {x \left (a^{2} d^{2} - 2 a b c d + b^{2} c^{2}\right )}{2 c^{2} d^{2} + 2 c d^{3} x^{2}} - \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (- \frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} + \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (\frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________